<?

require_once $_SERVER['DOCUMENT_ROOT']."/../_lib/base/common.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.template.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.holidays.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.holiday_top_deals.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.hotels.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.destinations.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.exchange_rates.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.holiday_special_offers.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.hotel_special_offers.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.reviews.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.lurls.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.airports.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.holiday_filters.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.tree.php";

	$lurls = new lurls();
	$holidays = new holidays();
	$destinations = new destinations();
	$hotels = new hotels();
	$airports = new airports();
	$template = new template();
	$tree = new tree();
	
	// Template
	$template->section_highlight = "home";
	$template->left_col = false;
	$template->search_tab = "holidays";
	$template->title = "Last minute holiday deals from Ireland";
	$template->meta_description = "Get the best Last Minute holidays offer from Ireland to Lanzarote, Majorca, Portugal, Turkey and more. Book online and save up to 30%";
	
	$template->ld_head();
	
	// Set form defaults
	$default_date = strtotime("+2 weeks");
	$holiday_search_form_values = array(
		"destination_tree_id"=>"",
		"departure_airport"=>"",
		"date_day"=>date('j',$default_date),
		"date_month"=>date('m-Y',$default_date),
		"give_take"=>"3",
		"nights"=>"7",
		"pax_adult"=>"2",
		"pax_child"=>"0"	
	);
    $hotel_search_form_values['date_day'] = date('j',$default_date);
	$hotel_search_form_values['date_month'] = date('m-Y',$default_date);
	
	
?>








<!-- Start left column -->


<div class="col_260 margin_right_10">




<div class="box_search_home">
<div class="box_search_home_shoe">
<div class="box_search_home_cap">



<div class="box_search_tabs">


	<ul>
		<li id="search_tab_holidays" class="search_tab_holidays_on" title="Last minute holidays"><div class="search_tab_holidays_div"><input name="search_type" id="search_type_holidays" value="holidays" type="radio" checked="checked" class="search_tab_radio" /><label class="search_form_label" for="search_type_holidays">Holidays</label></div></li>
		<li id="search_tab_hotels" class="search_tab_hotels_off" title="cheap hotels"><div class="search_tab_hotels_div"><input name="search_type" id="search_type_hotels" value="hotels" type="radio" class="search_tab_radio" /><label class="search_form_label" for="search_type_hotels">Hotels</label></div></li>
	</ul>

</div>




<div class="box_padding_search">



<!-- Start holidays search form -->

<div id="form_package">


<form method="post" action="/holidays/results_group.php" >

<input type="hidden" name="holiday_search" value="true" />


<div class="search_form_row">

<div class="search_form_home_label_col">
<label class="search_form_label" for="destination_tree_id_holidays">Destination</label>
</div>
<div class="search_form_home_input_col">
<? 
$destination_menu_class = "search_form_home_select_long";
require SITE_ROOT_PATH."/_lib/html/html_destination_menu_holidays.php";
?>
</div>


<div class="clearing"></div>

</div>

<div class="search_form_row">



<div class="search_form_home_label_col">
<label class="search_form_label" for="departure_airport">Departing</label>
</div>

<div class="search_form_home_input_col">
<? 
$departure_menu_class = "search_form_home_select_long";
require SITE_ROOT_PATH."/_lib/html/html_departure_menu.php";
?>
</div>

<div class="clearing"></div>

</div>




<? 


// Get the dates you want to display 
$input_dates = date_output(); 

?> 



<div class="search_form_row">

<div class="search_form_home_label_col">
<label class="search_form_label" for="holidays-date-day">Departure date</label>
</div>

<div class="search_form_home_input_col">

<div class="search_form_day_col">
<select name="date_day" id="holidays-date-day" class="search_form_select_day">
<?
	foreach($input_dates['days'] as $day){
?>
<option value='<?= $day['value'] ?>' <?= selected($day['value'],$holiday_search_form_values['date_day']) ?> ><?= $day['description'] ?></option>
<?
	}

?>
</select>
</div>

<div class="search_form_home_month_col">
<select name="date_month" id="holidays-date-month" class="search_form_home_select_month">
<?
	foreach($input_dates['months_year'] as $month_year){
?>
<option value='<?= $month_year['value'] ?>'  <?= selected($month_year['value'],$holiday_search_form_values['date_month']) ?>  ><?= $month_year['description'] ?></option>
<?
	}

?>
</select>
</div>

<!-- holidays datepicker element -->
<div class="search_form_datepicker_col">
<input id="datepicker-holidays" type="hidden" />
</div>


</div>

<div class="clearing"></div>

</div>





<div class="search_form_row">



<div class="search_form_home_label_col">
<label class="search_form_label" for="give_take">Give or take</label>
</div>

<div class="search_form_home_input_col">

<select name="give_take" id="give_take">
  <option value="1" <?= selected($holiday_search_form_values['give_take'],'1') ?>>1 day</option>
  <option value="2" <?= selected($holiday_search_form_values['give_take'],'2') ?>>2 days</option>
  <option value="3" <?= selected($holiday_search_form_values['give_take'],'3') ?>>3 days</option>
  <option value="4" <?= selected($holiday_search_form_values['give_take'],'4') ?>>4 days</option>
  <option value="5" <?= selected($holiday_search_form_values['give_take'],'5') ?>>5 days</option>
</select>
    
</div>

<div class="clearing"></div>

</div>







<div class="search_form_row">



<div class="search_form_home_label_col">
<label class="search_form_label" for="nights_holidays">Nights</label>
</div>

<div class="search_form_home_input_col">
	<select name="nights" id="nights_holidays" <?= $search_form_fields_class ?>>
	  <option value="">Any</option>
      <option value="4" <?= selected($holiday_search_form_values['nights'],'4') ?>>3 - 5 nights</option>
      <option value="7" <?= selected($holiday_search_form_values['nights'],'7') ?> >6 - 8 nights</option>
      <option value="11" <?= selected($holiday_search_form_values['nights'],'11') ?>>9 - 12 nights</option>
      <option value="14" <?= selected($holiday_search_form_values['nights'],'14') ?>>13+ nights</option>
    </select>
</div>

<div class="clearing"></div>

</div>















<div class="search_form_row">



<div class="search_form_home_label_col">
<label class="search_form_label" for="pax_adult">Passengers</label>
</div>

<div class="search_form_home_input_col">
    <span class="adult_small_text">Adult</span>
    <select name="pax_adult" id="pax_adult"  class="search_form_select_short">
        <option value="2" <?= selected($holiday_search_form_values['pax_adult'],'2') ?>>2</option>      
        <option value="3" <?= selected($holiday_search_form_values['pax_adult'],'3') ?>>3</option>
        <option value="4" <?= selected($holiday_search_form_values['pax_adult'],'4') ?>>4</option>
        <option value="5" <?= selected($holiday_search_form_values['pax_adult'],'5') ?>>5</option>
        <option value="6" <?= selected($holiday_search_form_values['pax_adult'],'6') ?>>6</option>
        <option value="7" <?= selected($holiday_search_form_values['pax_adult'],'7') ?>>7</option>
        <option value="8" <?= selected($holiday_search_form_values['pax_adult'],'8') ?>>8</option>
    </select>
    <span class="child_small_text">Child</span>
    <select name="pax_child" id="pax_child"  class="search_form_select_short">
        <option value="0" <?= selected($holiday_search_form_values['pax_child'],'0') ?>>0</option> 
        <option value="1" <?= selected($holiday_search_form_values['pax_child'],'1') ?>>1</option>   
        <option value="2" <?= selected($holiday_search_form_values['pax_child'],'2') ?>>2</option>  
        <option value="3" <?= selected($holiday_search_form_values['pax_child'],'3') ?>>3</option>
        <option value="4" <?= selected($holiday_search_form_values['pax_child'],'4') ?>>4</option>
        <option value="5" <?= selected($holiday_search_form_values['pax_child'],'5') ?>>5</option>
        <option value="6" <?= selected($holiday_search_form_values['pax_child'],'6') ?>>6</option>
    </select></div>

<div class="clearing"></div>

</div>









<div class="search_form_home_button_row">
<input type="image" src="/images/button_search.gif" value="submit" class="search_form_button" alt="Search" />
</div>


</form>

</div>

<!-- End holiday search form -->








<!-- Start hotel search form -->

<div id="form_hotel" class="hideme">


<form method="post" action="/hotels/hotel_results.php" >

<!--<input type="hidden" name="hotel_search" value="true" />-->
    <input type="hidden" name="action" value="hotel_search" />


<div class="search_form_row">

<div class="search_form_home_label_col">
<label class="search_form_label" for="destination_tree_id_hotels">Destination</label>
</div>
<div class="search_form_home_input_col">
<? 
$destination_menu_class = "search_form_home_select_long";
require SITE_ROOT_PATH."/_lib/html/html_destination_menu_hotels.php";
?>
</div>

<div class="clearing"></div>

</div>
    
<div class="search_form_row">    
    
<div class="search_form_home_label_col">
<label class="search_form_label" for="destination_tree_id_resorts">Resorts</label>
</div>
<div class="search_form_home_input_col">
<? 

$resort_menu_class = "search_form_home_select_long";
require SITE_ROOT_PATH."/_lib/html/html_destination_menu_resorts.php";
?>
</div>    
    
    
    

<div class="clearing"></div>

</div>

<? 


// Get the dates you want to display 
$input_dates = date_output(); 

?> 


<div class="search_form_row">

<div class="search_form_home_label_col">
<label class="search_form_label" for="hotels-date-day">Check-in date</label>
</div>

<div class="search_form_home_input_col">

<div class="search_form_day_col">
<select name="date_day" id="hotels-date-day" class="search_form_select_day">
<?
	foreach($input_dates['days'] as $day){
?>
<option value='<?= $day['value'] ?>' <?= selected($day['value'],$hotel_search_form_values['date_day']) ?> ><?= $day['description'] ?></option>
<?
	}

?>
</select>
</div>



<div class="search_form_home_month_col">
<select name="date_month" id="hotels-date-month" class="search_form_home_select_month">
<?
	foreach($input_dates['months_year'] as $month_year){
?>
<option value='<?= $month_year['value'] ?>'  <?= selected($month_year['value'],$hotel_search_form_values['date_month']) ?>  ><?= $month_year['description'] ?></option>
<?
	}
?>
</select>
</div>





<!-- hotels datepicker element -->
<div class="search_form_datepicker_col">
<input id="datepicker-hotels" type="hidden" />
</div>

</div>

<div class="clearing"></div>

</div>















<div class="search_form_row">



<div class="search_form_home_label_col">
<label class="search_form_label" for="nights_hotels">Nights</label>
</div>

<div class="search_form_home_input_col">
	<select name="nights" id="nights_hotels" class="search_form_select_med">
      <option value="1" <?= selected($hotel_search_form_values['nights'],'1') ?>>1</option>
      <option value="2" <?= selected($hotel_search_form_values['nights'],'2') ?>>2</option>            
      <option value="3" <?= selected($hotel_search_form_values['nights'],'3') ?>>3</option>
      <option value="4" <?= selected($hotel_search_form_values['nights'],'4') ?>>4</option>
      <option value="5" <?= selected($hotel_search_form_values['nights'],'5') ?>>5</option>
	  <option value="6" <?= selected($hotel_search_form_values['nights'],'6') ?>>6</option>
      <option value="7" <?= selected($hotel_search_form_values['nights'],'7') ?>>7</option>
      <option value="8" <?= selected($hotel_search_form_values['nights'],'8') ?>>8</option>
      <option value="9" <?= selected($hotel_search_form_values['nights'],'9') ?>>9</option>
      <option value="10" <?= selected($hotel_search_form_values['nights'],'10') ?>>10</option>
      <option value="11" <?= selected($hotel_search_form_values['nights'],'11') ?>>11</option>
      <option value="12" <?= selected($hotel_search_form_values['nights'],'12') ?>>12</option>
      <option value="13" <?= selected($hotel_search_form_values['nights'],'13') ?>>13</option>
      <option value="14" <?= selected($hotel_search_form_values['nights'],'14') ?>>14</option>
    </select>
</div>

<div class="clearing"></div>

</div>








<div class="search_form_row">

<div class="search_form_home_label_col">
<label class="search_form_label" for="no_rooms">No. rooms</label>
</div>

<div class="search_form_home_input_col">
<select name="no_rooms" id="no_rooms" class="search_form_select_med">
      <option value="1" <?= selected($hotel_search_form_values['no_rooms'],'1') ?>>1</option>
      <option value="2" <?= selected($hotel_search_form_values['no_rooms'],'2') ?>>2</option>
      <option value="3" <?= selected($hotel_search_form_values['no_rooms'],'3') ?>>3</option>
</select>
</div>

<div class="clearing"></div>

</div>









<!-- Start room 1 -->
<div id="room-1" class="search_form_row_room">

<div class="search_form_home_label_col">
<label class="search_form_label search_form_room_label" for="no_rooms">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Room 1</label>
</div>

<div class="search_form_home_input_col">
    
<span class="adult_small_text">Adult</span>
<select name="room_adults_1" class="search_form_select_short">
    <option value="1" <?= selected($hotel_search_form_values['room_adults_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_adults_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_adults_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_adults_1'],'4') ?>>4</option>
</select>


<span class="child_small_text">Child</span>
<select name="room_children_1" class="search_form_select_short" id="room_children_1"> 
    <option value="0" <?= selected($hotel_search_form_values['room_children_1'],'0') ?>>0</option>
    <option value="1" <?= selected($hotel_search_form_values['room_children_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_children_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_children_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_children_1'],'4') ?>>4</option>
</select>

</div>

    
    
    
    
    
    
<?php



function output_child_age_row($id){


    $children = 4;
    $max_age = 17;
    
  for ($index = 1; $index <= $children; $index++): 
       $selectName = 'room_children_'.$id.'_age_'. $index;
 ?>
       <div id="<?=$selectName ?>_div" class="search_form_room_child_age_row_home">
           <label>Child Age <?= $index; ?></label>
            <div class="search_form_room_child_age_col">
                <select name="<?=$selectName ?>" class="search_form_select_short">
                    <?php for ($i = 0; $i <=$max_age; $i++): ?> 
                            <option value="<?=$i?>" <?= selected($hotel_search_form_values[$selectName],$i) ?>> <?=$i?> </option>    
                    <? endfor ?>
                </select>
            </div>
        </div>       
<? 

        endfor; 

}
    
    
    output_child_age_row(1);
    
?>


<div class="clearing"></div>

</div>
<!-- End room 1 -->



<!-- Start room 2 -->
<div id="room-2" class="search_form_row_room">

<div class="search_form_home_label_col">
<label class="search_form_label search_form_room_label" for="no_rooms">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Room 2</label>
</div>

<div class="search_form_home_input_col">
    
<span class="adult_small_text">Adult</span>
<select name="room_adults_2" class="search_form_select_short">
    <option value="1" <?= selected($hotel_search_form_values['room_adults_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_adults_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_adults_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_adults_1'],'4') ?>>4</option>
</select>


<span class="child_small_text">Child</span>
<select name="room_children_2" class="search_form_select_short" id="room_children_2"> 
    <option value="0" <?= selected($hotel_search_form_values['room_children_1'],'0') ?>>0</option>
    <option value="1" <?= selected($hotel_search_form_values['room_children_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_children_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_children_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_children_1'],'4') ?>>4</option>
</select>

</div>

<?php
    output_child_age_row(2);
    
?>


<div class="clearing"></div>

</div>
<!-- End room 2 -->

<!-- Start room 3 -->
<div id="room-3" class="search_form_row_room">

<div class="search_form_home_label_col">
<label class="search_form_label search_form_room_label" for="no_rooms">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Room 3</label>
</div>

<div class="search_form_home_input_col">
    
<span class="adult_small_text">Adult</span>
<select name="room_adults_3" class="search_form_select_short">
    <option value="1" <?= selected($hotel_search_form_values['room_adults_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_adults_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_adults_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_adults_1'],'4') ?>>4</option>
</select>


<span class="child_small_text">Child</span>
<select name="room_children_3" class="search_form_select_short" id="room_children_3"> 
    <option value="0" <?= selected($hotel_search_form_values['room_children_1'],'0') ?>>0</option>
    <option value="1" <?= selected($hotel_search_form_values['room_children_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_children_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_children_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_children_1'],'4') ?>>4</option>
</select>

</div>

<?php
    output_child_age_row(3);
    
?>


<div class="clearing"></div>

</div>
<!-- End room 3 -->

<!-- Start room 4 -->
<div id="room-4" class="search_form_row_room">

<div class="search_form_home_label_col">
<label class="search_form_label search_form_room_label" for="no_rooms">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Room 4</label>
</div>

<div class="search_form_home_input_col">
    
<span class="adult_small_text">Adult</span>
<select name="room_adults_4" class="search_form_select_short">
    <option value="1" <?= selected($hotel_search_form_values['room_adults_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_adults_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_adults_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_adults_1'],'4') ?>>4</option>
</select>


<span class="child_small_text">Child</span>
<select name="room_children_4" class="search_form_select_short" id="room_children_4"> 
    <option value="0" <?= selected($hotel_search_form_values['room_children_1'],'0') ?>>0</option>
    <option value="1" <?= selected($hotel_search_form_values['room_children_1'],'1') ?>>1</option>
    <option value="2" <?= selected($hotel_search_form_values['room_children_1'],'2') ?>>2</option>
    <option value="3" <?= selected($hotel_search_form_values['room_children_1'],'3') ?>>3</option>
    <option value="4" <?= selected($hotel_search_form_values['room_children_1'],'4') ?>>4</option>
</select>

</div>

</div>
<!-- End room 4 -->









<div class="search_form_home_button_row">
<input type="image" src="/images/button_search.gif" value="submit" class="search_form_button" alt="Search" />
</div>


</form>

</div>

<!-- End hotel search form -->

</div>

</div>
</div>
</div>
    
<?php

flush();

?>
    


<? #include SITE_ROOT_PATH."/_lib/html/banners/banner_home_panel.php"; ?>

<!-- Start newsletter signup -->

<div class="box_or_260_cap">
<div class="box_or_260_shoe">
<div class="box_padding">

<h3 class="h3_white_plain">Get The Best Deals</h3>

	<form action="/newsletter.php" method="post" class="newsletter_form" name="newsletter_form">
	
	<input type="hidden" name="action" value="validate"/>
	
	<p class="white margin_bottom_5">Get our best <strong>Late Deals</strong> sent straight to your inbox.</p>
	
	<table class="newsletter_table">
	<tr>
	<td><input type="text" name="epost" class="text_newsletter_signup_big" value="Your email address" onblur="if(!this.value) this.value='Your email address';" onfocus="if(this.value) this.value='';" /></td>
	<td><div style="margin-left: 10px; text-align: center"><input type="image" src="/images/button_go_blue.gif" value="submit" alt="Submit" /></div></td>
	</tr></table>
		
	
	</form>
</div>
</div>
</div>


<!-- End newsletter signup -->







<? include SITE_ROOT_PATH."/_lib/html/banners/banner_250_250.php"; ?>


</div>
<!-- End left column -->











<!-- Start middle column -->

<div class="col_260 margin_right_10">




	
<?
$specials = new holiday_special_offers();
$params['order'] = "random";
$params['limit'] = "5";
$current_specials = $specials->get_specials($params);
shuffle($current_specials);
unset($params);
if(!empty($current_specials)){
$holiday_references = new holiday_references();
$holiday_filters = new holiday_filters();
?>



<!-- Start special offers -->



<div class="box_title_h3_bg">
<div class="box_title_h3_left">
<div class="box_title_h3_wm box_title_h3_wm_1">
<h3 class="box_title_h3" title="Cheap Holidays">Cheap Holidays</h3>
</div>
</div>
</div>


<?


foreach($current_specials as $special_values){

	// Holiday filter
	$filter_out = false;
	$params['holiday_reference_id'] = $special_values['reference_id'];
	if($holiday_filters->find_filtered_holiday($params)){
		$filter_out = true;
	}
	unset($params);
	
	// Get Holiday values
	$holiday_values = $holiday_references->build_holiday_keys(explode('~',$special_values['string']));

	
	// Filter by date
	if($holiday_values['departure_date']<=date('ymd')){
		$filter_out = true;
	}
	
if(!$filter_out){


	// Get hotel 
	$params['tree_id'] = $special_values['hotel_tree_id'];
	$params['cache']['seconds'] = '2400';
	$lookup = $hotels->lookup_hotel($params);
	unset($params);
	
	// Set values
	$hotel_values = $lookup['hotel_values'];
	$resort_values = $lookup['resort_values'];
	$destination_values = $lookup['destination_values'];


	// get photo url
	$lead_hotel_thumb_url = $tree->photo_url($hotel_values['main_photo']);
	
	// Departure airport lookup
	$params['airport_code'] = $holiday_values['departure_airport'];
	$params['cache']['seconds'] = '2400';
	$departure_airport_values = $airports->get_airport($params);
	unset($params);
	

	// Get the adult display price
	$display_price = floor($holiday_values['price_adult']);

	
	// Get LURL
	$params['reference_id'] = $special_values['reference_id'];
	$params['tree_id'] = $special_values['hotel_tree_id'];
	$offer_lurl = $lurls->get_holiday_lurl($params);
	unset($params);
	
	// Link titles
	$link_title = "Special offer holiday to ".$destination_values['name'];
	
	
?>


<!-- Start offer instance -->
<div class="lowlight offer_body_div" onclick="location='<?= $offer_lurl ?>'" onmouseover="this.className='highlight offer_body_div';" onmouseout="this.className='lowlight offer_body_div';">


<div class="col_70 margin_right_10">
    <div class='thumb_cover_div'>
    <a href="<?= $offer_lurl ?>" title="<?= $link_title ?>">
    <img src='<?= $lead_hotel_thumb_url ?>' alt='<?= $hotel_values['name'] ?>' class="thumb_image_70" />
    <img src="/images/thumb_cover_70_52.gif" class="thumb_cover" alt='<?= $hotel_values['name'] ?>'  />
    </a>
    </div>
</div>



<div class="col_170">

<p class="title_sbig"><a href="<?= $offer_lurl ?>" title="<?= $link_title ?>"><?= $destination_values['name'] ?></a></p>
<p class="title_smed"><a href="<?= $offer_lurl ?>" title="<?= $link_title ?>"><?= $hotel_values['name'] ?></a></p>
<p class="title_text"><?= $holiday_values['nights'] ?> nights, from <?= $departure_airport_values[0]['simple'] ?>, <a class="price_med" href="<?= $offer_lurl ?>" title="<?= $link_title ?>">&euro;<?= $display_price ?></a></p>

</div>


<div class="clearing"></div>



</div>
<!-- End offer instance -->


<?

unset($current_specials, $hotel_values,$resort_values,$destination_values,$departure_airport_values, $offer_lurl,$display_price);

} 

}


?>

<div style="margin-bottom: 10px"></div>

<!-- End special offers -->


<? } ?>










<!-- Start last minute holidays -->

<div class="box_title_h3_bg">
<div class="box_title_h3_left">
<div class="box_title_h3_wm box_title_h3_wm_4">
<h3 class="box_title_h3" title="Last Minute Holidays">Last Minute Holidays</h3>
</div>
</div>
</div>

<?

$holiday_top_deals = new holiday_top_deals();
$params['limit'] = '8';
$params['cache']['seconds'] = '600';
$holiday_top_deals_values = $holiday_top_deals->get_top_deals($params);
unset($params);
if(!empty($holiday_top_deals_values)){

$item_url = "";
$item_title = "";

?>

<ul class="list_last_min">
<?

	foreach($holiday_top_deals_values as $values_top_deals){
	

		// Get destination using airport code and name synonyms as paramaters
		$params['airport_code'] = $values_top_deals['destination_airport'];
		$params['type_id'] = '1';
		$params['position'] = 'bottom';
		$params['cache']['seconds'] = '2400';
		$destination_values = $destinations->destination_lookup($params);
		$destination_values = $destination_values[0];
		unset($params);
		
		// Get departure airport
		$params['airport_code'] = $values_top_deals['departure_airport'];
		$params['cache']['seconds'] = '2400';
		$item_departure_airport = $airports->get_airport($params);
		unset($params);
		
		$url_string = $lurls->holiday_list_lurl($values_top_deals);
	
?>

	<li><strong><?= $destination_values['name'] ?></strong>, <?= display_sabs_date($values_top_deals['departure_date'],'jS M') ?>, <?= $values_top_deals['nights'] ?>nts,  from <?= $item_departure_airport[0]['simple'] ?> <a class="price_med" href="<?= $url_string ?>">&euro;<?= $values_top_deals['price']; ?></a></li>
    
<?

}

?>	

</ul>

<ul class="list_qlinks">
  <li title="last minute holidays"><a href="/holidays/last_minute.html" title="last minute holidays">More last minute holidays</a></li>
</ul>


<?

}

?>


<!-- End last minute holidays -->



<!-- Notice Baner -->









<?
	// Display a random destination
	$random_destination = $destinations->get_random_destination();
	$random_destination = $random_destination[0];
	// Get LURL
	$destination_lurl = $lurls->get_branch_lurl($random_destination['tree_id']);
	unset($params);
	
	include SITE_ROOT_PATH."/_lib/html/highlight_destination.php";

?>















</div>

<!-- End middle column -->













<!-- Start right column -->

<div class="col_260">



<?
$specials = new hotel_special_offers();
$params['order'] = "random";
$params['limit'] = "5";
$current_specials = $specials->get_specials($params);
unset($params);
if(!empty($current_specials)){

?>


<!-- Start hotel deals -->
<div class="box_title_h3_bg">
<div class="box_title_h3_left">
<div class="box_title_h3_wm box_title_h3_wm_3">
<h3 class="box_title_h3" title="Cheap hotel deals">Hotel Deals</h3>
</div>
</div>
</div>



<?


foreach($current_specials as $special_values){


	// Get hotel 
	$params['tree_id'] = $special_values['hotel_tree_id'];
	$params['cache']['seconds'] = '2400';
	$lookup = $hotels->lookup_hotel($params);
	unset($params);
	
	// Set values
	$hotel_values = $lookup['hotel_values'];
	$resort_values = $lookup['resort_values'];
	$destination_values = $lookup['destination_values'];
	

	// get photo url
	$lead_hotel_thumb_url = $tree->photo_url($hotel_values['main_photo']);
	
	
	// Get the display price
	$display_price = $special_values['price_per_night']; 

	
	// Get LURL
	$offer_lurl = $lurls->get_branch_lurl($hotel_values['tree_id']);

	// Link title
	$link_title = "Cheap hotels in ".$resort_values['name'].", ".$destination_values['name'];
	
	
?>


<!-- Start offer instance -->
<div class="lowlight offer_body_div" onclick="location='<?= $offer_lurl ?>'" onmouseover="this.className='highlight offer_body_div';" onmouseout="this.className='lowlight offer_body_div';">

<div class="col_70 margin_right_10">
    <div class='thumb_cover_div'>
    <a href="<?= $offer_lurl ?>" title="<?= $link_title ?>">
    <img src='<?= $lead_hotel_thumb_url ?>' alt='<?= $hotel_values['name'] ?>' class="thumb_image_70" />
    <img src="/images/thumb_cover_70_52.gif" class="thumb_cover" alt='<?= $hotel_values['name'] ?>'  />
    </a>
    </div>
</div>



<div class="col_170">

<p class="title_sbig"><a href="<?= $offer_lurl ?>" title="Book <?= $hotel_values['name'] ?> online"><?= $hotel_values['name'] ?></a></p>
<p class="title_smed"><a href="<?= $offer_lurl ?>" title="<?= $link_title ?>"><?= $destination_values['name'] ?></a></p>
<p class="title_text"><?= output_rating($hotel_values['hotel_rating'], "star", true); ?> from <a class="price_med" href="<?= $offer_lurl ?>" title="<?= $hotel_values['name'] ?> offer">&euro;<?= $display_price ?></a> per room per night</p>

</div>


<div class="clearing"></div>



</div>
<!-- End offer instance -->


<?

unset($current_specials, $hotel_values,$resort_values,$destination_values,$departure_airport_values, $offer_lurl,$display_price);

} 


?>

<div style="margin-bottom: 10px"></div>

<!-- End hotel deals -->



<? } ?>














<? 

$handle = fopen(FILE_TOP_SEARCHES, "r");
$top_destinations_file_contents = fread($handle, filesize(FILE_TOP_SEARCHES));
fclose($handle);

$top_destinations = explode(',', $top_destinations_file_contents);

if(!empty($top_destinations)){
?>


<!-- Start top destinations -->
<div class="box_title_h3_bg">
<div class="box_title_h3_left">
<div class="box_title_h3_wm box_title_h3_wm_2">
<h3 class="box_title_h3" title="Most popular holiday destinations">Top Destinations</h3>
</div>
</div>
</div>



<div class="watermark_hat">

<p>Top holiday destinations this week:</p>

<ul>
<?
$destinations_id_array = array();
$i=0;
foreach($top_destinations as $destination_airport_code){


	$params['airport_code'] = $destination_airport_code;
	$params['type_id'] = '1';
	$params['position'] = 'bottom';
	$params['cache']['seconds'] = '2400';
	$destination_values = $destinations->destination_lookup($params);
	$destination_values = $destination_values[0];
	unset($params);
	
	$destination_lurl = $lurls->get_branch_lurl($destination_values['tree_id']);

	
	if($destination_values AND (!in_array($destination_values['tree_id'], $destinations_id_array))){

		echo "<li title='".$destination_values['name']." holidays'><a href='".$destination_lurl."' title='".$destination_values['name']."'>".$destination_values['name']."</a></li>";
		
		$i++;
		
	}

	$destinations_id_array[] = $destination_values['tree_id'];
	
	if($i>9) break;
	
} 

?>
</ul>


</div>

<!-- End top destinations -->
<? } ?>





<!-- Start travel insurance -->
<div class="box_title_h3_bg">
<div class="box_title_h3_left">
<div class="box_title_h3_wm box_title_h3_wm_5">
<h3 class="box_title_h3" title="Cheap Travel Insurance">Cheap Travel Insurance</h3>
</div>
</div>
</div>


<p>We offer amazing rate like <strong>Single Trip</strong> insurance from only <a href="http://www.blueinsurance.ie/whitelabel/blueWL_LateDeals.asp?AgencyID=1109">&euro;5.50</a> and <strong>Multi Trip</strong> cover from <a href="http://www.blueinsurance.ie/whitelabel/blueWL_LateDeals.asp?AgencyID=1109">&euro;27.00</a>.</p>

<ul class="list_qlinks">
  <li title="Cheap Travel Insurance"><a title="Cheap Travel Insurance" href="http://www.blueinsurance.ie/whitelabel/blueWL_LateDeals.asp?AgencyID=1109">Cheap Travel Insurance</a></li>
</ul>


<!-- End travel insurance -->







</div>

<!-- End right column -->












<!-- Google Code for Late Deals Home Page Remarketing List -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1065994132;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "85EvCMjE4QIQlI-n_AM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1065994132/?label=85EvCMjE4QIQlI-n_AM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>



<?

	$template->ld_foot();
	
?>
